//package map.graph;
//
//import java.util.LinkedList;
//
///**
// * @author S
// * 
// */
//public class BestCarsAnalysis {
//
//	private int p;
//	private LinkedList<Car> result = new LinkedList<Car>();
//
//	public BestCarsAnalysis(int processCount) {
//		p = processCount;
//	}
//
//	/**
//	 * @param cars
//	 * @param clientNode
//	 * @param k
//	 * @return k best cars
//	 */
//	public Node[] getBestCars(LinkedList<Node> cars, Node clientNode, int k) {
//
//		int n = cars.size();
//
//		int[] indexes = new int[p + 2];
//		indexes[0] = 0;
//		indexes[p+1] = n;
//		//indexes[p + 1] = n;
//
//		for (int i = 1; i < p; i++) {
//			indexes[i] = n * i / p;
//		}
//
//		AStarThread[] ath = new AStarThread[p];
//
//		for (int i = 0; i < p; i++) {
//			ath[i] = new AStarThread(
//					clientNode,
//					(LinkedList<Node>) cars.subList(indexes[i], indexes[i + 1]),
//					result);
//			ath[i].start();
//		}
//
//		Node[] arr = new Node[k];
//		double[] arrc = new double[k];
//
//		for (int i = 0; i < k; i++) {
//			arrc[i] = -1.0;
//		}
//
//		for (Car car : result) {
//			for (int i = 0; i < k; i++) {
//				if ((car.getTime() < arrc[i]) && (arrc[i] > 0)) {
//					arr[i] = car.getNode();
//					break;
//				}
//			}
//		}
//
//		return arr;
//	}
//
////	/**
////	 * @param args
////	 */
////	public static void main(String[] args) {
////		System.out.println("hello!");
////
////		Node n1 = new Node(1, 50.382195711135864, 30.477914214134216);
////
////		Node n2 = new Node(2, 50.392414927482605, 30.484914779663086);
////		// From 50.382195711135864 30.477914214134216 to 50.392414927482605
////		// 30.484914779663086 for 452000
////		Node n3 = new Node(3, 50.3950971364975, 30.49925923347473);
////		// From 50.392414927482605 30.484914779663086 to 50.3950971364975
////		// 30.49925923347473 for 227000
////		Node n4 = new Node(4, 50.397672057151794, 30.497950315475464);
////		// From 50.3950971364975 30.49925923347473 to 50.397672057151794
////		// 30.497950315475464 for 99000
////		Node n5 = new Node(5, 50.398873686790466, 30.4990017414093);
////		// From 50.397672057151794 30.497950315475464 to 50.398873686790466
////		// 30.4990017414093 for 20000
////		Node n6 = new Node(6, 50.40372312068939, 30.512412786483765);
////		// From 50.398873686790466 30.4990017414093 to 50.40372312068939
////		// 30.512412786483765 for 172000
////		Node n7 = new Node(7, 50.40728509426117, 30.513705611228943);
////		// From 50.40372312068939 30.512412786483765 to 50.40728509426117
////		// 30.513705611228943 for 86000
////		Node n8 = new Node(8, 50.4077410697937, 30.506962537765503);
////		// From 50.40728509426117 30.513705611228943 to 50.4077410697937
////		// 30.506962537765503 for 69000
////		Node n9 = new Node(9, 50.407124161720276, 30.501930713653564);
////		// From 50.4077410697937 30.506962537765503 to 50.407124161720276
////		// 30.501930713653564 for 279000
////
////		Way w1 = new Way(1, n1, n2, 452000);
////		Way w2 = new Way(2, n2, n3, 227000);
////		Way w3 = new Way(2, n3, n4, 99000);
////		Way w4 = new Way(2, n4, n5, 20000);
////		Way w5 = new Way(2, n5, n6, 172000);
////		Way w6 = new Way(2, n6, n7, 86000);
////		Way w7 = new Way(2, n7, n8, 69000);
////		Way w8 = new Way(2, n8, n9, 279000);
////
////		LinkedList<Way> ways1 = new LinkedList<Way>();
////		ways1.add(w1);
////		n1.setWays(ways1);
////
////		LinkedList<Way> ways2 = new LinkedList<Way>();
////		ways2.add(w1);
////		ways2.add(w2);
////		n2.setWays(ways2);
////
////		LinkedList<Way> ways3 = new LinkedList<Way>();
////		ways3.add(w2);
////		ways3.add(w3);
////		n3.setWays(ways3);
////
////		LinkedList<Way> ways4 = new LinkedList<Way>();
////		ways4.add(w3);
////		ways4.add(w4);
////		n4.setWays(ways4);
////
////		LinkedList<Way> ways5 = new LinkedList<Way>();
////		ways5.add(w4);
////		ways5.add(w5);
////		n5.setWays(ways5);
////
////		LinkedList<Way> ways6 = new LinkedList<Way>();
////		ways6.add(w5);
////		ways6.add(w6);
////		n6.setWays(ways2);
////
////		LinkedList<Way> ways7 = new LinkedList<Way>();
////		ways7.add(w6);
////		ways7.add(w7);
////		n7.setWays(ways2);
////
////		LinkedList<Way> ways8 = new LinkedList<Way>();
////		ways8.add(w7);
////		ways8.add(w8);
////		n8.setWays(ways2);
////
////		LinkedList<Way> ways9 = new LinkedList<Way>();
////		ways9.add(w8);
////		n9.setWays(ways2);
////	
////
////	}
////
// }
